home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_02
/
1002036a
< prev
next >
Wrap
Text File
|
1991-12-04
|
539b
|
28 lines
/* Listing 1 */
#include <stdio.h>
#include <stdlib.h>
#define PAL_LEN 256
typedef struct
{
int red;
int grn;
int blu;
int num;
} pal;
pal palo[ PAL_LEN ]; /* original palette */
pal pals[ PAL_LEN ]; /* sorted palette */
/* index for the sorted palette */
int redindex[ PAL_LEN ];
/* prototypes */
int closest( int red, int green, int blue );
long dist( int red, int green, int blue, int num );
void sort_color();
int color_comp( const void *a, const void *b );